package com.fable.sp.core.repository;

import com.fable.sp.core.domain.ContainerTable;
import com.slyak.spring.jpa.GenericJpaRepository;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

/**
 * .
 *
 * @author stormning on 16/8/15.
 */
public interface ContainerTableRepository extends GenericJpaRepository<ContainerTable, Long> {

    @CacheEvict(cacheManager = "spCacheManager", value = "ct_findOne", key = "#p0.id")
    @Override
    <S extends ContainerTable> S save(S entity);

    @Cacheable(cacheManager = "spCacheManager", value = "ct_findOne", key = "#p0")
    @Override
    ContainerTable findOne(Long id);
}
